<template>
	<view class="flex-row center-column"
		style="background-image: linear-gradient(#FF552F, #FF785A); height: 100%; overflow: hidden;">
		<image style="margin-top: 280rpx; width: 75%;"
			src="https://mcdn.chatgk.com/xcx/static/images/login/qidongye.png" mode="widthFix"></image>
		<image class="pdy-image-title" src="https://mcdn.chatgk.com/xcx/static/images/login/qidongye_title.png"
			mode="widthFix"></image>

		<view class="image-bottom">
			<image style="width: 100%; height: 100%;"
				src="https://mcdn.chatgk.com/xcx/static/images/login/qidongye_bottom.png" mode="heightFix">
			</image>
			<image class="pdy-image-bottom-title"
				src="https://mcdn.chatgk.com/xcx/static/images/login/qidongye_bottom_text.png" mode="widthFix">
			</image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// imgMode: ''
			};
		},
		onLoad() {

			// 针对android平台的启动4做隐藏操作
			// if (uni.getSystemInfoSync().platform == 'ios') {
			// 	this.imgMode = 'aspectFill'
			// } else if (uni.getSystemInfoSync().platform == 'android') {
			// 	this.imgMode = ''
			// }

			const userInfo = getApp().globalData.userInfo
			const firstLogin = uni.getStorageSync("isFirstLogin")
			const isfirstLogin = !Boolean(firstLogin)
			// const isNewUser = uni.getStorageSync("isNewUser")

			// if (!isNewUser) {
			// 	uni.setStorageSync('isAgree', false)
			// 	uni.redirectTo({
			// 		url: './guidepage'
			// 	})
			// } else 
			if (userInfo || !isfirstLogin) {
				if (!userInfo) {
					uni.switchTab({
						url: '/pages/tabBar/home/home'
					})
				} else if (userInfo.setpwd == '1') {
					uni.redirectTo({
						url: '/pages/login/set-password'
					})
				} else if (!userInfo.pid) {
					uni.redirectTo({
						url: '/subpackages/subpackage2/pages/login/perfect-info'
					})
				} else if (!userInfo.score) {
					uni.redirectTo({
						url: '/subpackages/subpackage1/pages/score/home-score?data=' + JSON.stringify({
							"isLoginPush": true
						})
					})
				} else {
					uni.switchTab({
						url: '/pages/tabBar/home/home'
					})
				}
			} else {
				uni.redirectTo({
					url: '/pages/login/login-home?isNavBack=0'
				})
			}
		},
		methods: {

		}
	}
</script>

<style>
	.pdy-image-title {
		position: absolute;
		top: 100rpx;
		left: 40rpx;
		right: 40rpx;
		width: calc(100% - 80rpx);
	}

	.pdy-image-bottom-title {
		position: absolute;
		bottom: 120rpx;
		left: 96rpx;
		right: 96rpx;
		width: calc(100% - 192rpx);
	}

	.image-bottom {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		height: 500rpx;
		width: 100%;
	}
</style>